
#pragma once

#include "User.h"

#include <string>

class ServiceProvider;

class UserManager
{
public:
	explicit UserManager(ServiceProvider* const i_sp);
	~UserManager();

	void Clear();
	
	void AddUser(const std::string &i_name);
	UsersList& GetUserList();
	const UsersList& GetUserList() const;
	void CheckLosingPlayers();
	std::vector<std::string> m_gameoverNames;

private:
	ServiceProvider* m_sp;
	UsersList m_list;
};

inline void UserManager::AddUser(const std::string &i_name)
{
	m_list.push_back(new User(m_sp, i_name));
}

inline UsersList& UserManager::GetUserList()
{
	return m_list;
}

inline const UsersList& UserManager::GetUserList() const
{
	return m_list;
}
